package com.wss.day02.test05;

/**
 * @author wangshaoshuai
 * @desc TODO
 * @date 2025/4/21
 */
public class Order {
    private long orderId;
    private User owner;
    private Goods[] goodsList;

    public Order(long orderId, User owner, Goods[] goodsList) {
        this.orderId = orderId;
        this.owner = owner;
        this.goodsList = goodsList;
    }


    public void showGoodsDetails() {
        System.out.println("订单号：" + orderId);
        System.out.println("所属用户：" + owner.getName());
        System.out.println("商品详情：");
        for (Goods goods : goodsList) {
            goods.showInfo();
            System.out.println("------------------");
        }
    }


    public long getOrderId() {
        return orderId;
    }

    public User getOwner() {
        return owner;
    }

    public Goods[] getGoodsList() {
        return goodsList;
    }
}
